import axios from 'axios';

function reqData(reqBody, currentPage, pageSize) {
  var requestData = {
    "currentPage": currentPage ? currentPage : null,
    "pageSize": pageSize ? pageSize : null,
    "query": reqBody
  };
  return requestData;
}
function postMethod(reqUrl, data, ifblob, isHeader) {

  return new Promise(function (resolve, reject) {
    axios({
      headers: {
        'Content-Type': isHeader ? "multipart/form-data" : 'application/json;charset=UTF-8',
      },
      method: 'POST',
      baseURL: 'http://114.115.201.136:28088',
      url: reqUrl,
      data: data, //入参加密
      timeout: 180000,
      responseType: ifblob == true ? 'blob' : null
    }).then(function (res) {
      resolve(res);
    }, function (e) {
    });
  })
}
export {
  reqData,
  postMethod
}